#ifndef __AVAPIS_SERVER_h__
#define __AVAPIS_SERVER_h__

#include <pthread.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdarg.h>
#include <sys/time.h>
#include <ctype.h>
#include "IOTCAPIs.h"
#include "AVAPIs.h"
#include "AVFRAMEINFO.h"
#include "AVIOCTRLDEFs.h"
#include "ProductTestFeed.h"
#include "ProductTestKey.h"
#include "InSdkRingBuffer.h"
#include "ProductTestHandle.h"
#include "InCommon.h"

#define MAX_CLIENT_NUMBER	8

#define VIDEO_BUF_SIZE	(1024 * 600)
#define AUDIO_BUF_SIZE	1280

#define ENABLE_RESEND 1

#define SERVTYPE_STREAM_SERVER 	0	//((1<<12)|(1<<18)|(1<<20)|(1<<21)|(1<<22))	/* 佳可设备特征能力值 */

#define FPS 30   // Video FPS
#define DASA_HIGH_FPS           30
#define DASA_BTWHIGHNORMAL_FPS  20
#define DASA_NORMAL_FPS         15
#define DASA_BTWNORMALLOW_FPS   10
#define DASA_LOW_FPS            5

#define AUDIO_FORMAT_PCM  // modify this define for test which audio format

#ifdef AUDIO_FORMAT_PCM
#define AUDIO_FRAME_SIZE 640
#define AUDIO_FPS 25
#define AUDIO_CODEC 0x8C
#endif

typedef struct _AV_Client
{
	int avIndex;
    int avCmdIndex;
    unsigned char bEnableAudio;
	unsigned char bEnableVideo;
	unsigned char bEnableSpeaker;
	unsigned char bStopPlayBack;
	unsigned char bPausePlayBack;
	unsigned char bSendCache;
    unsigned char bTwoWayStream;
	int speakerCh;
	int playBackCh;
    //For DASA -- start
    int doCleanBuffer;
    int doCleanBufferDone;
    int waitKeyFrame;
    //For DASA -- end
	SMsgAVIoctrlPlayRecord playRecord;
	pthread_rwlock_t sLock;
}AV_Client;

int ProductTest_P2P_Main(pStSdkRingBufInfoProducer producer);

#endif

